package com.baidu.www;
class Student{
    public String name;
    public  int age;
    static String classroom;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("带参数的构造方法");
    }
    {
        System.out.println("构造代码块");
        this.age=15;
    }
    static{
        System.out.println("静态代码块");
        classroom="二年级三班";
    }


}
public class Text {
    public static void main(String[] args) {
        Student student1=new Student("lihua",12);
        Student student2=new Student("xiaofang",11);
        String ret=Student.classroom;
        System.out.println(ret);


    }

    public static void main2(String[] args) {
            {
                //定义在方法里面的，称为普通代码块
            }
    }
}
